package com.zkthink.ceres.product.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.product.entity.ProductSkuAttr;

import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * sku的规格
 * </p>
 *
 * @author JustArgo
 * @date 2020-05-07
 */
@Repository
public interface ProductSkuAttrMapper extends SuperMapper<ProductSkuAttr> {
    int delSkuAttrBySkuId(Long skuId);

    /** 根据skuId 查找对应的sku规格
     * @author JustArgo 2020/5/10 18:22
     * @return
     */
    List<ProductSkuAttr> selectBySkuId(Long skuId);

    /** 查找设置指定规格的skuId列表
     * @author JustArgo 2020/5/30 10:56
     * @return
     */
    List<Long> selectSkuIdListByBatchAttrId(List<Long> deletedAttrIdList);

    /** 查找本次改动没被删除的skuId
     * @author JustArgo 2020/5/30 12:01
     * @return
     */
    List<Long> selectSkuIdListByBatchAttrValueId(List<Long> notDeletedAttrValueIdList);

    /** 逻辑删除批量sku
     * @author JustArgo 2020/5/30 16:18
     * @return
     */
    int delSkuAttrByBatchSkuId(List<Long> shouldDeletedSkuIdList);

    /** 删除sku和规格的对应关系
     * @author JustArgo 2020/5/30 16:35
     * @return
     */
    int deleteByAttrIdList(List<Long> deletedAttrIdList);
}
